<template>
  <div>
    <div v-for="(userInfo, index) in userInfoList">
      <baseInfoInput :info="userInfo" :infoName="index"></baseInfoInput>
    </div>
  </div>
</template>
<script >
import BaseInfoInput from '@/views/BasicInfo/BaseInfoInput'
import { mapState, mapActions } from 'vuex'

export default {
  name: 'user-info',
  components: {BaseInfoInput},
  data () {
    let user = this.$store.state.user
    let typeList = {}
    for (let item in user) {
      let info = {}
      info.isEditButtonShow = false
      info.isEditType = false
      typeList[item] = info
    }
    return {
      info: '',
      typeList: typeList
    }
  },
  computed: mapState({
    userInfoList: state => state.user
  }),
  created () {
    this.getUserInfo()
  },
  methods: {
    ...mapActions([
      'getUserInfo'
    ])
  }
}
</script>
<style>
</style>
